<!DOCTYPE html>
<html><head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
    <link rel="canonical" href="/unity-mythirdperson/init/">

    <title>
        
        Init | h-book
        
    </title>

    
    <link href="/css/fontawesome.min.css" rel="stylesheet">

    
    <link rel="stylesheet" href="/css/ace.min.css">

    

    

</head>
<body><nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow sticky-top" id="navbarMain">
    <div class="container">
        <div>
            <a class="navbar-brand" href="/">
                
                h-book
            </a>
        </div>
    </div>
</nav>
<div class="container-fluid">
            <div class="row">

                <div class="docs-sidenav order-0 col-12 col-md-3 col-lg-2 col-xl-2 position-sticky border-right"><nav class="navbar navbar-expand-md navbar-light pl-0">
    <button class="navbar-toggler navbar-toggler-right collapsed" type="button" data-toggle="collapse" data-target="#sidenav-left-collapse" aria-controls="sidenav-left-collapse" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

     <div class="collapse navbar-collapse align-items-start flex-column" id="sidenav-left-collapse">
            <form class="form-inline my-2 my-lg-0 searchbox">
                <input class="form-control mr-sm-2 w-100" data-search-input id="search-by" type="text" placeholder="Search">
            </form>

        

         <ul class="navbar-nav flex-column pt-3">
    <li data-nav-id="/hugo/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/hugo/"><h6>Hugo</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/hugo/init/" class="nav-item my-1">
                
                
                  <a href="/hugo/init/" class="nav-link p-0">
                    init
                  </a>
                
        </li>
        <li data-nav-id="/hugo/add-page/" class="nav-item my-1">
                
                
                  <a href="/hugo/add-page/" class="nav-link p-0">
                    add-page
                  </a>
                
        </li>
        <li data-nav-id="/hugo/edit-skill/" class="nav-item my-1">
                
                
                  <a href="/hugo/edit-skill/" class="nav-link p-0">
                    edit-skill
                  </a>
                
        </li>
        <li data-nav-id="/hugo/publish/" class="nav-item my-1">
                
                
                  <a href="/hugo/publish/" class="nav-link p-0">
                    publish
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/android/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/android/"><h6>Android</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/android/install/" class="nav-item my-1">
                
                
                  <a href="/android/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/android/create-project/" class="nav-item my-1">
                
                
                  <a href="/android/create-project/" class="nav-link p-0">
                    create project
                  </a>
                
        </li>
        <li data-nav-id="/android/import-material/" class="nav-item my-1">
                
                
                  <a href="/android/import-material/" class="nav-link p-0">
                    import material
                  </a>
                
        </li>
        <li data-nav-id="/android/start-page/" class="nav-item my-1">
                
                
                  <a href="/android/start-page/" class="nav-link p-0">
                    startpage
                  </a>
                
        </li>
        <li data-nav-id="/android/i18n/" class="nav-item my-1">
                
                
                  <a href="/android/i18n/" class="nav-link p-0">
                    i18n
                  </a>
                
        </li>
        <li data-nav-id="/android/nav-flat-page/" class="nav-item my-1">
                
                
                  <a href="/android/nav-flat-page/" class="nav-link p-0">
                    nav flat page
                  </a>
                
        </li>
        <li data-nav-id="/android/activity/" class="nav-item my-1">
                
                
                  <a href="/android/activity/" class="nav-link p-0">
                    Activity
                  </a>
                
        </li>
        <li data-nav-id="/android/db/" class="nav-item my-1">
                
                
                  <a href="/android/db/" class="nav-link p-0">
                    DB
                  </a>
                
        </li>
        <li data-nav-id="/android/dialog/" class="nav-item my-1">
                
                
                  <a href="/android/dialog/" class="nav-link p-0">
                    Dialog
                  </a>
                
        </li>
        <li data-nav-id="/android/fragment/" class="nav-item my-1">
                
                
                  <a href="/android/fragment/" class="nav-link p-0">
                    Fragment
                  </a>
                
        </li>
        <li data-nav-id="/android/jetpack/" class="nav-item my-1">
                
                
                  <a href="/android/jetpack/" class="nav-link p-0">
                    Jetpack
                  </a>
                
        </li>
        <li data-nav-id="/android/material/" class="nav-item my-1">
                
                
                  <a href="/android/material/" class="nav-link p-0">
                    Material
                  </a>
                
        </li>
        <li data-nav-id="/android/storage/" class="nav-item my-1">
                
                
                  <a href="/android/storage/" class="nav-link p-0">
                    Storage
                  </a>
                
        </li>
        <li data-nav-id="/android/%E5%9B%BE%E6%A0%87/" class="nav-item my-1">
                
                
                  <a href="/android/%E5%9B%BE%E6%A0%87/" class="nav-link p-0">
                    图标
                  </a>
                
        </li>
        <li data-nav-id="/android/store/" class="nav-item my-1">
                
                
                  <a href="/android/store/" class="nav-link p-0">
                    Store
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/blender/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/blender/"><h6>Blender</h6></a>
        
    </li>
    <li data-nav-id="/bootstrap/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/bootstrap/"><h6>BootStrap</h6></a>
        
    </li>
    <li data-nav-id="/centos7/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/centos7/"><h6>Centos7</h6></a>
        
    </li>
    <li data-nav-id="/dlna/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dlna/"><h6>DLNA</h6></a>
        
    </li>
    <li data-nav-id="/docker/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/docker/"><h6>Docker</h6></a>
        
    </li>
    <li data-nav-id="/dubbo/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dubbo/"><h6>Dubbo</h6></a>
        
    </li>
    <li data-nav-id="/ffmpeg/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/ffmpeg/"><h6>FFmpeg</h6></a>
        
    </li>
    <li data-nav-id="/git/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/git/"><h6>Git</h6></a>
        
    </li>
    <li data-nav-id="/gitbook/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gitbook/"><h6>Gitbook</h6></a>
        
    </li>
    <li data-nav-id="/gitlab/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/gitlab/"><h6>Gitlab</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/gitlab/runner/" class="nav-item my-1">
                
                
                  <a href="/gitlab/runner/" class="nav-link p-0">
                    Runner
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/gradle/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gradle/"><h6>Gradle</h6></a>
        
    </li>
    <li data-nav-id="/java/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/java/"><h6>Java</h6></a>
        
    </li>
    <li data-nav-id="/jenkins/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/jenkins/"><h6>Jenkins</h6></a>
        
    </li>
    <li data-nav-id="/kubernetes/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/kubernetes/"><h6>Kubernetes</h6></a>
        
    </li>
    <li data-nav-id="/mybatis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis/"><h6>Mybatis</h6></a>
        
    </li>
    <li data-nav-id="/mybatis-plus/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis-plus/"><h6>Mybatis Plus</h6></a>
        
    </li>
    <li data-nav-id="/mysql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mysql/"><h6>MySQL</h6></a>
        
    </li>
    <li data-nav-id="/nodejs/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/nodejs/"><h6>Node.js</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/nodejs/npm/" class="nav-item my-1">
                
                
                  <a href="/nodejs/npm/" class="nav-link p-0">
                    NPM
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/postgresql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/postgresql/"><h6>PostgreSQL</h6></a>
        
    </li>
    <li data-nav-id="/redis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/redis/"><h6>Redis</h6></a>
        
    </li>
    <li data-nav-id="/samba/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/samba/"><h6>Samba</h6></a>
        
    </li>
    <li data-nav-id="/sql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/sql/"><h6>SQL</h6></a>
        
    </li>
    <li data-nav-id="/ue5/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/ue5/"><h6>UE5</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/ue5/install/" class="nav-item my-1">
                
                
                  <a href="/ue5/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/ue5/uninstall/" class="nav-item my-1">
                
                
                  <a href="/ue5/uninstall/" class="nav-link p-0">
                    uninstall
                  </a>
                
        </li>
        <li data-nav-id="/ue5/qa/" class="nav-item my-1">
                
                
                  <a href="/ue5/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity/"><h6>Unity</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity/install/" class="nav-item my-1">
                
                
                  <a href="/unity/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/unity/scene/" class="nav-item my-1">
                
                
                  <a href="/unity/scene/" class="nav-link p-0">
                    scene
                  </a>
                
        </li>
        <li data-nav-id="/unity/inspector/" class="nav-item my-1">
                
                
                  <a href="/unity/inspector/" class="nav-link p-0">
                    inspector
                  </a>
                
        </li>
        <li data-nav-id="/unity/assets/" class="nav-item my-1">
                
                
                  <a href="/unity/assets/" class="nav-link p-0">
                    assets
                  </a>
                
        </li>
        <li data-nav-id="/unity/audio-source/" class="nav-item my-1">
                
                
                  <a href="/unity/audio-source/" class="nav-link p-0">
                    audio source
                  </a>
                
        </li>
        <li data-nav-id="/unity/camera/" class="nav-item my-1">
                
                
                  <a href="/unity/camera/" class="nav-link p-0">
                    camera
                  </a>
                
        </li>
        <li data-nav-id="/unity/script/" class="nav-item my-1">
                
                
                  <a href="/unity/script/" class="nav-link p-0">
                    script
                  </a>
                
        </li>
        <li data-nav-id="/unity/prefabs/" class="nav-item my-1">
                
                
                  <a href="/unity/prefabs/" class="nav-link p-0">
                    prefabs
                  </a>
                
        </li>
        <li data-nav-id="/unity/physics/" class="nav-item my-1">
                
                
                  <a href="/unity/physics/" class="nav-link p-0">
                    physics
                  </a>
                
        </li>
        <li data-nav-id="/unity/skybox/" class="nav-item my-1">
                
                
                  <a href="/unity/skybox/" class="nav-link p-0">
                    skybox
                  </a>
                
        </li>
        <li data-nav-id="/unity/particle-system/" class="nav-item my-1">
                
                
                  <a href="/unity/particle-system/" class="nav-link p-0">
                    particle system
                  </a>
                
        </li>
        <li data-nav-id="/unity/shortcut-keys/" class="nav-item my-1">
                
                
                  <a href="/unity/shortcut-keys/" class="nav-link p-0">
                    shortcut keys
                  </a>
                
        </li>
        <li data-nav-id="/unity/qa/" class="nav-item my-1">
                
                
                  <a href="/unity/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-beginner/"><h6>Unity 2D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-beginner/init-and-move/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/init-and-move/" class="nav-link p-0">
                    Init &amp; Move
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/map/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/map/" class="nav-link p-0">
                    Map
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/data/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/data/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/animate/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/animate/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/bullet/" class="nav-link p-0">
                    Bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/cinemachine/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/cinemachine/" class="nav-link p-0">
                    Cinemachine
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/particle/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/particle/" class="nav-link p-0">
                    Particle
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/npc/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/npc/" class="nav-link p-0">
                    NPC
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-game-kit/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-game-kit/"><h6>Unity 2D Game Kit</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-game-kit/record/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-game-kit/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-3d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-3d-beginner/"><h6>Unity 3D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-3d-beginner/init/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/level/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/level/" class="nav-link p-0">
                    Level
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/nav/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/nav/" class="nav-link p-0">
                    Nav
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/render-pipeline/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/render-pipeline/" class="nav-link p-0">
                    Render Pipeline
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/postprocessing/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/postprocessing/" class="nav-link p-0">
                    PostProcessing
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/enemy/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/enemy/" class="nav-link p-0">
                    Enemy
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-link p-0">
                    建模工具
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-arpg/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-arpg/"><h6>Unity ARPG</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-arpg/init/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/role-state-machine/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/role-state-machine/" class="nav-link p-0">
                    Role State Machine
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/api-piece/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/api-piece/" class="nav-link p-0">
                    API Piece
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-animation/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-animation/"><h6>Unity Creativecore Animation</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-animation/door/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/door/" class="nav-link p-0">
                    Door
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-animation/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-lighting/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-lighting/"><h6>Unity Creativecore Lighting</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-lighting/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-lighting/outdoor/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/outdoor/" class="nav-link p-0">
                    Outdoor
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-shader/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-shader/"><h6>Unity Creativecore Shader</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-shader/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/glass/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/glass/" class="nav-link p-0">
                    Glass
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/shader-graph/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/shader-graph/" class="nav-link p-0">
                    Shader-Graph
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-beginner-code/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-beginner-code/"><h6>Unity Creator Kit Beginner Code</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-beginner-code/record/" class="nav-item my-1">
                
                
                  <a href="/unity-creator-kit-beginner-code/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-fps/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-fps/"><h6>Unity Creator Kit FPS</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-fps/record/" class="nav-item my-1">
                
                
                  <a href="/unity-creator-kit-fps/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-mythirdperson/" class="nav-item my-1 parent haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-mythirdperson/"><h6>Unity My Third Person</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-mythirdperson/init/" class="nav-item my-1 active">
                
                
                  <a href="/unity-mythirdperson/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-playground/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-playground/"><h6>Unity Playground</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-playground/record/" class="nav-item my-1">
                
                
                  <a href="/unity-playground/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-ui/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-ui/"><h6>Unity UI</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-ui/init/" class="nav-item my-1">
                
                
                  <a href="/unity-ui/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-vfx/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-vfx/"><h6>Unity VFX</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-vfx/init/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/bullet/" class="nav-link p-0">
                    bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rain/" class="nav-link p-0">
                    rain
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rock-rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rock-rain/" class="nav-link p-0">
                    Rock Rain
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/vue/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/vue/"><h6>Vue</h6></a>
        
    </li>
    <li data-nav-id="/web/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/web/"><h6>Web</h6></a>
        
    </li>
        </ul>
    </div>
</nav>


</div>
                <div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky border-left"><div class="docs-toc">
	<nav id="TableOfContents">
  <ul>
    <li><a href="#导入资源">导入资源</a></li>
    <li><a href="#使用资源中的场景">使用资源中的场景</a></li>
    <li><a href="#创建角色">创建角色</a></li>
    <li><a href="#创建相机">创建相机</a></li>
    <li><a href="#用-blend-tree-管理动画">用 Blend Tree 管理动画</a></li>
    <li><a href="#添加跑步动画">添加跑步动画</a></li>
    <li><a href="#添加跳跃">添加跳跃</a></li>
    <li><a href="#用一个blend-tree来控制idle-walk-run">用一个blend tree来控制idle walk run</a></li>
  </ul>
</nav>
</div>
</div>
                <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-8 py-3">
                

<div class="d-flex flex-column">
    <h1 class="js-title">Init</h1>
    <div class="d-flex align-items-center">
        
    </div>
</div>

<hr>


<p>2024.09.18</p>
<h2 id="导入资源">导入资源</h2>
<ol>
<li>老版本支持默认渲染管线，新版本需要用 URP</li>
<li>导入过程中会遇到一个确认框，大意为资源需要新版的控制，而工程是旧版，是否需要修改。这里可以点叉关闭，在Eidt -&gt; ProjectSettings -&gt; Player -&gt; Active Input Handling 设置为 Both （通常选一种即可，这里只为了记录另一种可能性）</li>
</ol>
<h2 id="使用资源中的场景">使用资源中的场景</h2>
<ol>
<li>Assets/StarterAssets/ThirdPersonController/Scenes/Playground.unity</li>
<li>Hierarchy 中只保留 Lighting 和 Environment （删除或者把其它的 Active 勾勾去掉）</li>
<li>解压 ProSwordandShieldPack.zip 到 Assets/Arts/ImportModels/ 目录下</li>
<li>选择 Assets/Arts/ImportModels/Paladin WProp J Nordstrom.fbx ，在 Inspector 的 Model 选项卡中，勾选 Bake Axis Conversion ； Rig 选项卡中，把 Animation Type 设置为 Humanoid ，并勾选 Optimize Game Objects ； Materials 选项卡中，点击 Extract Textures ，解压到 Assets/Arts/ImportModels/Textures 目录下</li>
<li>全选除了 Paladin WProp J Nordstrom.fbx 以外的所有 fbx ，在 Inspector 的 Model 选项卡中，勾选 Bake Axis Conversion ； Rig 选项卡中，把 Animation Type 设置为 Humanoid ， Avatar Definition 选择 Copy From Other Avatar ， 在 Source 中选择 Paladin WProp J NordstromAvatar 。 点击 Apply 应用掉刚才的设置</li>
<li>按需选择需要的动画（fbx），比如 Assets/Arts/ImportModels/sword and shield walk.fbx ，在 Inspector 的中把动画的名称改了，甚至把fbx改了，如 Assets/Arts/ImportModels/sword and shield walk (2).fbx 改为 Assets/Arts/ImportModels/sword and shield walk back.fbx ，以及勾选 Loop Time</li>
</ol>
<h2 id="创建角色">创建角色</h2>
<ol>
<li>将 Assets/Arts/ImportModels/Paladin WProp J Nordstrom.fbx 拖到 Hierarchy 中，并重命名为 Player</li>
<li>创建 Assets/Arts/Animations/Player Animator Controller.controller</li>
<li>展开 Assets/Arts/ImportModels/sword and shield idle.fbx ，对里面的动画按 ctrl + D 复制一份。对 walk 也操作一次，然后将 idle 和 walk 剪切到 Animations 文件夹下，再添加到 Animator Controller 中</li>
<li>Animator 窗口中添加 float 类型的 speed 属性，然后在 idle 和 walk 之间创建相互的 Transition ，都把 Has Exit Time 勾取消。idle 到 walk 的 Conditions 为 speed &gt; 0 ，walk 到 idle 的 Conditions 为 speed &lt; 0.1</li>
<li>将 Player 的 Animator Controller 设置为 Player Animator Controller ，并取消 Apply Root Motion 勾。就可以运行游戏，测试修改 speed 能否执行动画（需要在 Scene 中观察，因为 Game 窗口会出现黑底白字 Display 1 No cameras rendering）</li>
<li>创建 Assets/Scripts/PlayerController.cs 脚本，挂载到 Player 上，并添加如下代码：</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">PlayerController</span> <span style="color:#111">:</span> <span style="color:#111">MonoBehaviour</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Animator</span> <span style="color:#111">animator</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Rigidbody</span> <span style="color:#111">rb</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">1.8f</span><span style="color:#111">;</span> <span style="color:#75715e">// 这个值大约和动画相匹配</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">runSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">0f</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">currentSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">horizontal</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">vertical</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Vector3</span> <span style="color:#111">direction</span><span style="color:#111">;</span> <span style="color:#75715e">// 方向</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Start</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Animator</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">rb</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Rigidbody</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Update</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">horizontal</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Horizontal&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">vertical</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Vertical&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 对刚体操作</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">FixedUpdate</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">Vector3</span> <span style="color:#111">input</span> <span style="color:#111">=</span> <span style="color:#00a8c8">new</span> <span style="color:#111">Vector3</span><span style="color:#111">(</span><span style="color:#111">horizontal</span><span style="color:#111">,</span> <span style="color:#ae81ff">0</span><span style="color:#111">,</span> <span style="color:#111">vertical</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">direction</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">normalized</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入时</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">&gt;</span> <span style="color:#ae81ff">0</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 旋转</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">rotation</span> <span style="color:#111">=</span> <span style="color:#111">Quaternion</span><span style="color:#111">.</span><span style="color:#111">LookRotation</span><span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">,</span> <span style="color:#111">Vector3</span><span style="color:#111">.</span><span style="color:#111">up</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 移动</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">Vector3</span> <span style="color:#111">p</span> <span style="color:#111">=</span> <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">p</span> <span style="color:#111">+=</span> <span style="color:#111">direction</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">*</span> <span style="color:#111">Time</span><span style="color:#111">.</span><span style="color:#111">deltaTime</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">rb</span><span style="color:#111">.</span><span style="color:#111">MovePosition</span><span style="color:#111">(</span><span style="color:#111">p</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 因为输入会是 -1 到 1 的带过渡的值</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 所以从开始移动到正式移动，用乘法会实现静止到移动的过渡</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">currentSpeed</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span><span style="color:#111">;</span> 
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetFloat</span><span style="color:#111">(</span><span style="color:#d88200">&#34;speed&#34;</span><span style="color:#111">,</span> <span style="color:#111">currentSpeed</span><span style="color:#111">);</span> 
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><ol start="7">
<li>给 Player 添加 Rigidbody 和 Capsule Collider 。可以运行游戏测试移动控制</li>
</ol>
<p><strong>备注：</strong></p>
<p>实现移动的方法有多种</p>
<ol>
<li>用 Transform 的 <code>.position</code> ，直接修改坐标，能实现A B两点的瞬间移动</li>
<li>用 Transform 的 <code>Translate()</code> ,仅仅只移动</li>
<li>Vector3.Lerp/Vector3.Slerp/Vector3.MoveTowardsVecor3/Vector3.SmoothDamp</li>
<li>用 RigidBody 的 <code>AddForce()</code> ，提供一个力，按物理系统移动</li>
<li>用 RigidBody 的 <code>.velocity</code> ，直接更改速度，但忽略静态摩擦力</li>
<li>用 RigidBody 的 <code>.MovePosition()</code> ，受到物理约束的情况下，移动到指定点</li>
<li>用 CharacterController 的 <code>Move()</code> ，模拟更复杂的运动</li>
<li>用 CharacterController 的 <code>SimpleMove()</code> ，模拟简单运动</li>
<li>用 Apply Root Motion ，让动画的移动生效</li>
</ol>
<p>不存在一种方式能适应所有情况，需要按需选择</p>
<h2 id="创建相机">创建相机</h2>
<ol>
<li>创建一个 Camera</li>
<li>创建一个 Cinemachine 的 Virtual Camera ，对 Body 改为 3rd Person Follow</li>
<li>给 Player 添加一个子空对象，放置到胸口高度，作为相机的跟随点（Virtual Camera 的 Follow 值）</li>
<li>调整 Virtual Camera 的 Body 子属性，达到画面需求（远近、高矮）</li>
<li>把 Player 的 Rigidbody 中 Freeze X Z 勾选，不然会出问题，比如会摔倒后不停翻滚</li>
</ol>
<p>此时运行游戏控制方向移动，并不会好用</p>
<ol start="6">
<li>将 Body 改为 Transposer ， Binding Mode 改为 World Space ，然后调整 Follow Offset 的值，来调整相机位置</li>
</ol>
<h2 id="用-blend-tree-管理动画">用 Blend Tree 管理动画</h2>
<ol>
<li>在 Animator 中右键创建 Blend Tree ，并改名为 idle_walk</li>
<li>双击 idle_walk 后再点击 Blend Tree ，在 Inspector 中的 Blend Type 选中 1D 。对 Motion 添加两个，并把上面的 idle 和 walk 赋值过来</li>
<li>回到 Animator 窗口，将 idle_walk 设置为默认 state</li>
<li>加速移动的话，需要修改 PlayerController.cs 脚本的 walkSpeed ，还要修改 idle_walk 里面 walk Motion 的 speed 值（左边是 Thresh 右边镜像的图标）。这样移动速度和动画频率才能匹配上</li>
</ol>
<h2 id="添加跑步动画">添加跑步动画</h2>
<ol>
<li>将 Assets/Arts/ImportModels/sword and shield run.fbx 的 run 动画同理复制到 Assets/Arts/Animations 下</li>
<li>在 idle_walk（可以改名加个run） 的 blend tree 中添加 run 动画，取消勾选 Automate Thresholds。 将 idle 的 Threshold 改为 0 ，将 walk 的 Threshold 改为 1.8 ，将 run 的 Threshold 改为 5</li>
<li>修改 PlayerController.cs 脚本，添加按住 shift 键时，切换到 run 动画，如下</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">PlayerController</span> <span style="color:#111">:</span> <span style="color:#111">MonoBehaviour</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Animator</span> <span style="color:#111">animator</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Rigidbody</span> <span style="color:#111">rb</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">1.8f</span><span style="color:#111">;</span> <span style="color:#75715e">// 这个值大约和动画相匹配</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">runSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">5f</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">currentSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">horizontal</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">vertical</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Vector3</span> <span style="color:#111">direction</span><span style="color:#111">;</span> <span style="color:#75715e">// 方向</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">bool</span> <span style="color:#111">running</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Start</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Animator</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">rb</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Rigidbody</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Update</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">horizontal</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Horizontal&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">vertical</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Vertical&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetKeyDown</span><span style="color:#111">(</span><span style="color:#111">KeyCode</span><span style="color:#111">.</span><span style="color:#111">LeftShift</span><span style="color:#111">))</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">running</span> <span style="color:#111">=</span> <span style="color:#00a8c8">true</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetKeyUp</span><span style="color:#111">(</span><span style="color:#111">KeyCode</span><span style="color:#111">.</span><span style="color:#111">LeftShift</span><span style="color:#111">))</span> 
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">running</span> <span style="color:#111">=</span> <span style="color:#00a8c8">false</span><span style="color:#111">;</span> 
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 对刚体操作</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">FixedUpdate</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">Vector3</span> <span style="color:#111">input</span> <span style="color:#111">=</span> <span style="color:#00a8c8">new</span> <span style="color:#111">Vector3</span><span style="color:#111">(</span><span style="color:#111">horizontal</span><span style="color:#111">,</span> <span style="color:#ae81ff">0</span><span style="color:#111">,</span> <span style="color:#111">vertical</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">direction</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">normalized</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入时</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">&gt;</span> <span style="color:#ae81ff">0</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 旋转</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">rotation</span> <span style="color:#111">=</span> <span style="color:#111">Quaternion</span><span style="color:#111">.</span><span style="color:#111">LookRotation</span><span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">,</span> <span style="color:#111">Vector3</span><span style="color:#111">.</span><span style="color:#111">up</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 移动</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">Vector3</span> <span style="color:#111">p</span> <span style="color:#111">=</span> <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">running</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>                <span style="color:#111">p</span> <span style="color:#111">+=</span> <span style="color:#111">direction</span> <span style="color:#111">*</span> <span style="color:#111">runSpeed</span> <span style="color:#111">*</span> <span style="color:#111">Time</span><span style="color:#111">.</span><span style="color:#111">deltaTime</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">else</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>                <span style="color:#111">p</span> <span style="color:#111">+=</span> <span style="color:#111">direction</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">*</span> <span style="color:#111">Time</span><span style="color:#111">.</span><span style="color:#111">deltaTime</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">rb</span><span style="color:#111">.</span><span style="color:#111">MovePosition</span><span style="color:#111">(</span><span style="color:#111">p</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 因为输入会是 -1 到 1 的带过渡的值</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 所以从开始移动到正式移动，用乘法会实现静止到移动的过渡</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">running</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">currentSpeed</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">*</span> <span style="color:#111">runSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">currentSpeed</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetFloat</span><span style="color:#111">(</span><span style="color:#d88200">&#34;speed&#34;</span><span style="color:#111">,</span> <span style="color:#111">currentSpeed</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="添加跳跃">添加跳跃</h2>
<ol>
<li>将 Assets/Arts/ImportModels/sword and shield jump (2).fbx 的动画照旧操作。粘贴后选中这个 jump ，在 Inspector 中的 Root Transform Position (Y) 下的 Bake Into Pose 勾选（否则不会有向上跳的效果）</li>
<li>在 Animator 把 jump 的动画添加进来。从 Anybody State 连接到 jump ； 从 jump 连接到 idle_walk</li>
<li>Animator 添加一个 trigger ，名字叫 jump 。 Anybody State 到 jump 的连接添加 Conditions 为 jump 。 jump 到 idle_walk 的连接，勾选 Has Exit Time</li>
<li>修改 PlayerController.cs 脚本，添加按住 空格 键时，切换到 jump 动画，如下</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">PlayerController</span> <span style="color:#111">:</span> <span style="color:#111">MonoBehaviour</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Animator</span> <span style="color:#111">animator</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Rigidbody</span> <span style="color:#111">rb</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">1.8f</span><span style="color:#111">;</span> <span style="color:#75715e">// 这个值大约和动画相匹配</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">runSpeed</span> <span style="color:#111">=</span> <span style="color:#ae81ff">5f</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">currentSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">horizontal</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">float</span> <span style="color:#111">vertical</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#111">Vector3</span> <span style="color:#111">direction</span><span style="color:#111">;</span> <span style="color:#75715e">// 方向</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">bool</span> <span style="color:#111">running</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">bool</span> <span style="color:#111">jumping</span><span style="color:#111">;</span> <span style="color:#75715e">// TODO 避免重复跳。控制跳跃高度</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Start</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Animator</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">rb</span> <span style="color:#111">=</span> <span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Rigidbody</span><span style="color:#111">&gt;();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">Update</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">horizontal</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Horizontal&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">vertical</span> <span style="color:#111">=</span> <span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetAxis</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Vertical&#34;</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetKeyDown</span><span style="color:#111">(</span><span style="color:#111">KeyCode</span><span style="color:#111">.</span><span style="color:#111">LeftShift</span><span style="color:#111">))</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">running</span> <span style="color:#111">=</span> <span style="color:#00a8c8">true</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetKeyUp</span><span style="color:#111">(</span><span style="color:#111">KeyCode</span><span style="color:#111">.</span><span style="color:#111">LeftShift</span><span style="color:#111">))</span> 
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">running</span> <span style="color:#111">=</span> <span style="color:#00a8c8">false</span><span style="color:#111">;</span> 
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">Input</span><span style="color:#111">.</span><span style="color:#111">GetKeyDown</span><span style="color:#111">(</span><span style="color:#111">KeyCode</span><span style="color:#111">.</span><span style="color:#111">Space</span><span style="color:#111">))</span> <span style="color:#75715e">// 这里的逻辑有问题，可以连续按空格，以打断的方式重复触发动画</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">jumping</span> <span style="color:#111">=</span> <span style="color:#00a8c8">true</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetTrigger</span><span style="color:#111">(</span><span style="color:#d88200">&#34;jump&#34;</span><span style="color:#111">);</span> <span style="color:#75715e">// 放到 FixedUpdate 中执行会明显有问题</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span> <span style="color:#00a8c8">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">jumping</span> <span style="color:#111">=</span> <span style="color:#00a8c8">false</span><span style="color:#111">;</span> <span style="color:#75715e">// TODO 解决逻辑有问题</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 对刚体操作</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">FixedUpdate</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">Vector3</span> <span style="color:#111">input</span> <span style="color:#111">=</span> <span style="color:#00a8c8">new</span> <span style="color:#111">Vector3</span><span style="color:#111">(</span><span style="color:#111">horizontal</span><span style="color:#111">,</span> <span style="color:#ae81ff">0</span><span style="color:#111">,</span> <span style="color:#111">vertical</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">direction</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">normalized</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 用户输入时</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">&gt;</span> <span style="color:#ae81ff">0</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 旋转</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">rotation</span> <span style="color:#111">=</span> <span style="color:#111">Quaternion</span><span style="color:#111">.</span><span style="color:#111">LookRotation</span><span style="color:#111">(</span><span style="color:#111">direction</span><span style="color:#111">,</span> <span style="color:#111">Vector3</span><span style="color:#111">.</span><span style="color:#111">up</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// 移动</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">Vector3</span> <span style="color:#111">p</span> <span style="color:#111">=</span> <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">running</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>                <span style="color:#111">p</span> <span style="color:#111">+=</span> <span style="color:#111">direction</span> <span style="color:#111">*</span> <span style="color:#111">runSpeed</span> <span style="color:#111">*</span> <span style="color:#111">Time</span><span style="color:#111">.</span><span style="color:#111">deltaTime</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">else</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>                <span style="color:#111">p</span> <span style="color:#111">+=</span> <span style="color:#111">direction</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span> <span style="color:#111">*</span> <span style="color:#111">Time</span><span style="color:#111">.</span><span style="color:#111">deltaTime</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">rb</span><span style="color:#111">.</span><span style="color:#111">MovePosition</span><span style="color:#111">(</span><span style="color:#111">p</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 因为输入会是 -1 到 1 的带过渡的值</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 所以从开始移动到正式移动，用乘法会实现静止到移动的过渡</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">running</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">currentSpeed</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">*</span> <span style="color:#111">runSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">currentSpeed</span> <span style="color:#111">=</span> <span style="color:#111">input</span><span style="color:#111">.</span><span style="color:#111">magnitude</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetFloat</span><span style="color:#111">(</span><span style="color:#d88200">&#34;speed&#34;</span><span style="color:#111">,</span> <span style="color:#111">currentSpeed</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="用一个blend-tree来控制idle-walk-run">用一个blend tree来控制idle walk run</h2>
<ol>
<li>新建一个 blend tree ，并进入编辑</li>
<li>将 Blend Type 改为 2D Freedom Direction</li>
<li>新增 v_h 和 v_v 两个 float 参数，并在 blend tree 中使用</li>
<li>将 idle 动画设置 Pos X 0 ， Pos Y 0</li>
<li>将 walk(有4个方向移动的动画) 前设置 0 1.8 ，后设置 0 -1.8 ，左设置为 -1.8 0 ，右设置为 1.8 0</li>
<li>将 run 同理设置，只是将 1.8 改为 5</li>
<li>用代码对 v_h 和 v_v 赋值即可</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#111">Vector3</span> <span style="color:#111">velocity</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">running</span><span style="color:#111">)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">velocity</span> <span style="color:#111">=</span> <span style="color:#00a8c8">new</span> <span style="color:#111">Vector3</span><span style="color:#111">(</span><span style="color:#111">horizontal</span><span style="color:#111">,</span> <span style="color:#ae81ff">0</span><span style="color:#111">,</span> <span style="color:#111">vertical</span><span style="color:#111">)</span> <span style="color:#111">*</span> <span style="color:#111">runSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span> <span style="color:#00a8c8">else</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">velocity</span> <span style="color:#111">=</span> <span style="color:#00a8c8">new</span> <span style="color:#111">Vector3</span><span style="color:#111">(</span><span style="color:#111">horizontal</span><span style="color:#111">,</span> <span style="color:#ae81ff">0</span><span style="color:#111">,</span> <span style="color:#111">vertical</span><span style="color:#111">)</span> <span style="color:#111">*</span> <span style="color:#111">walkSpeed</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetFloat</span><span style="color:#111">(</span><span style="color:#d88200">&#34;v_h&#34;</span><span style="color:#111">,</span> <span style="color:#111">velocity</span><span style="color:#111">.</span><span style="color:#111">x</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span><span style="color:#111">animator</span><span style="color:#111">.</span><span style="color:#111">SetFloat</span><span style="color:#111">(</span><span style="color:#d88200">&#34;v_v&#34;</span><span style="color:#111">,</span> <span style="color:#111">velocity</span><span style="color:#111">.</span><span style="color:#111">z</span><span style="color:#111">);</span>
</span></span></code></pre></div>

    


                    
                    <div class="row"></div> 

                </div>

            </div> 

        </div> 
<script src="/lib/jquery.min.js"></script> 
<script src="/lib/popper.min.js"></script> 

<script src="/js/bootstrap.min.js"></script> 


<script type="text/javascript" src="/plugins/lunr.min.js"></script>
<script type="text/javascript" src="/plugins/auto-complete.js"></script>
<link href="/plugins/auto-complete.css" rel="stylesheet">
<script type="text/javascript">
  
      var baseurl = "\/";
  
</script>
<script type="text/javascript" src="/plugins/search.js"></script>

<script type="text/javascript" src="/plugins/favorites.js"></script>


<script type="text/javascript" src="/plugins/clipboard.js"></script>
<script>
  new ClipboardJS('.btn');
</script>
</body>
</html>
